package regex;

import java.util.regex.Matcher;
import java.util.regex.Pattern;





public class LearnRegex {
	public static void main(String[] args) {
		String s="4646-asdaliajsdi";
		LearnRegex l= new LearnRegex();
		l.testRegex(s);
		
	}
	
	public boolean testRegex(String str){
		Pattern p=Pattern.compile("\\d{2,3}-\\d{7,8}");
		Matcher m=p.matcher(str);
		System.out.println(str+":"+m.matches());	
		System.out.println(m.toMatchResult());
		return m.matches();
	}
}
